#include <cmath>
size_t calculate_m(size_t n, double p) {
	auto res = n * log(p) / (log(2) * log(2));
	return -res;
}

size_t calculate_k(size_t m, size_t n) {
	return static_cast<size_t>(m / n * log(2));
}